package com.wuxiaolong.androidmvpsample.retrofit;

import com.wuxiaolong.androidmvpsample.mvp.main.MainModel;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;
import rx.Observable;

/**
 * Created by WuXiaolong on 2016/3/24.
 * github:https://github.com/WuXiaolong/
 * 微信公众号：吴小龙同学
 * 个人博客：http://wuxiaolong.me/
 */
public interface ApiStores {
    //baseUrl
//    String API_SERVER_URL = "http://192.168.204.37:8083/ReserveStation/";
//    String API_SERVER_URL = "http://192.168.0.19:8081/saa/";
//    String API_SERVER_URL = "http://wdev.virsical.cn/saa/";
    String API_SERVER_URL = "http://192.168.204.132:8080/Workflow/workflow/workflowInfo/findSelectSubs/";
//    String API_SERVER_URL = "http://192.168.202.206:8089/sales/";
//    String API_SERVER_URL = "http://www.weather.com.cn/";

    //加载天气
    //, @Path("cityId") String cityId
    //"adat/sk/{cityId}.html"
    @GET()
    Call<MainModel> loadDataByRetrofit(@Url String url);

    @Multipart
    @POST()
    Call<String> uploadFile(@Url() String url, @Part List<MultipartBody.Part> partList);

    @POST
    Call<String> userLogin(@Url String url, @QueryMap Map<String, String> options);

    //加载天气
//    @GET("adat/sk/{cityId}.html")
//    Observable<MainModel> loadDataByRetrofitRxjava(@Path("cityId") String cityId);
    //加载天气
    @GET()
    Observable<MainModel> loadDataByRetrofitRxjava(@Url String url, @QueryMap Map<String, String> options);

    //"api/app/user/login"
    @POST("login")
    Observable<MainModel> postMapUserInfoRx(@QueryMap Map<String, String> options);

    @Multipart
    @POST("client/addSales")
    Observable<MainModel> postFileUser(@Part MultipartBody.Part file, @PartMap Map<String, String> map);

    @Multipart
    @POST("smart/personal/appeal?tokenSn=8039&lang=zh_CN")
    Observable<MainModel> postFilesUser(@PartMap Map<String, List<RequestBody>> params,
                                        @PartMap Map<String, String> map);

    @Multipart
    @POST("smart/personal/appeal?tokenSn=8039&lang=zh_CN")
    Observable<MainModel> postFilesUsers(@PartMap Map<String, RequestBody> params,
                                         @PartMap Map<String, String> map);
}
